package com.tianruan.psychological.moduls.sys.user.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tianruan.psychological.common.utils.encryption.Md5Utils;
import com.tianruan.psychological.moduls.sys.user.entry.db.UserDO;
import com.tianruan.psychological.moduls.sys.user.entry.dto.UserDTO;
import com.tianruan.psychological.moduls.sys.user.entry.vo.UserVO;
import com.tianruan.psychological.moduls.sys.user.mapper.UserMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: Dong
 * @Email: dong980514280@gmail.com
 * @Create: 2020-09-20 10:07
 * @PS
 */
@Service
public interface IUserService extends IService<UserDO> {

    UserDTO getUserPermissionByNo(String username);

    IPage<UserVO> pageUser(Page<UserVO> page,
                                  String no,
                                  String username,
                                  String phone,
                                  String email,
                                  String role);

    UserVO getUserRoleById(String id);

    UserDTO updateUser(String id, UserDTO userDTO);

    UserDTO insertUser(UserDTO userDTO);

    String getPassword(String id);

    /**
     * 判断密码是否相等
     * @param id
     * @param password
     * @return
     */
    Boolean equalsPassword(String id, String password);


    /**
     * 根据id修改密码
     * @param id
     * @param password
     */
    void modifyPassword(String id, String password);

}
